package com.xiaoxu.bbs.controller;

import com.xiaoxu.bbs.common.ReturnResults;
import com.xiaoxu.bbs.entity.Board;
import com.xiaoxu.bbs.service.BoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/board")
public class BoardController {

    @Autowired
    private BoardService boardService;

    @GetMapping("/lists")
    public ReturnResults<List<Board>> getBoardList(){
        List<Board> boardList = boardService.list();
        return ReturnResults.success(boardList);
    }

}
